Skip to main content
POST
/
api
/
v1
/
tasks
Create and upload a :ref:`ref_flyteidl.admin.Task` definition
curl --request POST \
  --url https://mycluster.domino.tech/api/v1/tasks \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": {
    "resource_type": "UNSPECIFIED",
    "project": "<string>",
    "domain": "<string>",
    "name": "<string>",
    "version": "<string>",
    "org": "<string>"
  },
  "spec": {
    "template": {
      "id": {
        "resource_type": "UNSPECIFIED",
        "project": "<string>",
        "domain": "<string>",
        "name": "<string>",
        "version": "<string>",
        "org": "<string>"
      },
      "type": "<string>",
      "metadata": {
        "discoverable": true,
        "runtime": {
          "type": "OTHER",
          "version": "<string>",
          "flavor": "<string>"
        },
        "timeout": "<string>",
        "retries": {
          "retries": 123
        },
        "discovery_version": "<string>",
        "deprecated_error_message": "<string>",
        "interruptible": true,
        "cache_serializable": true,
        "tags": {},
        "pod_template_name": "<string>",
        "cache_ignore_input_vars": [
          "<string>"
        ],
        "is_eager": true,
        "generates_deck": true,
        "metadata": {
          "labels": {},
          "annotations": {}
        }
      },
      "interface": {
        "inputs": {
          "variables": {}
        },
        "outputs": {
          "variables": {}
        }
      },
      "custom": {},
      "container": {
        "image": "<string>",
        "command": [
          "<string>"
        ],
        "args": [
          "<string>"
        ],
        "resources": {
          "requests": [
            {
              "name": "UNKNOWN",
              "value": "<string>"
            }
          ],
          "limits": [
            {
              "name": "UNKNOWN",
              "value": "<string>"
            }
          ]
        },
        "env": [
          {
            "key": "<string>",
            "value": "<string>"
          }
        ],
        "config": [
          {
            "key": "<string>",
            "value": "<string>"
          }
        ],
        "ports": [
          {
            "container_port": 123,
            "name": "<string>"
          }
        ],
        "data_config": {
          "enabled": true,
          "input_path": "<string>",
          "output_path": "<string>",
          "format": "JSON",
          "io_strategy": {
            "download_mode": "DOWNLOAD_EAGER",
            "upload_mode": "UPLOAD_ON_EXIT"
          }
        },
        "architecture": "UNKNOWN"
      },
      "k8s_pod": {
        "metadata": {
          "labels": {},
          "annotations": {}
        },
        "pod_spec": {},
        "data_config": {
          "enabled": true,
          "input_path": "<string>",
          "output_path": "<string>",
          "format": "JSON",
          "io_strategy": {
            "download_mode": "DOWNLOAD_EAGER",
            "upload_mode": "UPLOAD_ON_EXIT"
          }
        },
        "primary_container_name": "<string>"
      },
      "sql": {
        "statement": "<string>",
        "dialect": "UNDEFINED"
      },
      "task_type_version": 123,
      "security_context": {
        "run_as": {
          "iam_role": "<string>",
          "k8s_service_account": "<string>",
          "oauth2_client": {
            "client_id": "<string>",
            "client_secret": {
              "group": "<string>",
              "group_version": "<string>",
              "key": "<string>",
              "mount_requirement": "ANY",
              "env_var": "<string>"
            }
          },
          "execution_identity": "<string>"
        },
        "secrets": [
          {
            "group": "<string>",
            "group_version": "<string>",
            "key": "<string>",
            "mount_requirement": "ANY",
            "env_var": "<string>"
          }
        ],
        "tokens": [
          {
            "name": "<string>",
            "type": "CLIENT_CREDENTIALS",
            "client": {
              "client_id": "<string>",
              "client_secret": {
                "group": "<string>",
                "group_version": "<string>",
                "key": "<string>",
                "mount_requirement": "ANY",
                "env_var": "<string>"
              }
            },
            "idp_discovery_endpoint": "<string>",
            "token_endpoint": "<string>"
          }
        ]
      },
      "extended_resources": {
        "gpu_accelerator": {
          "device": "<string>",
          "unpartitioned": true,
          "partition_size": "<string>"
        },
        "shared_memory": {
          "mount_path": "<string>",
          "mount_name": "<string>",
          "size_limit": "<string>"
        }
      },
      "config": {}
    },
    "description": {
      "id": {
        "resource_type": "UNSPECIFIED",
        "project": "<string>",
        "domain": "<string>",
        "name": "<string>",
        "version": "<string>",
        "org": "<string>"
      },
      "short_description": "<string>",
      "long_description": {
        "value": "<string>",
        "uri": "<string>",
        "format": "DESCRIPTION_FORMAT_UNKNOWN",
        "icon_link": "<string>"
      },
      "source_code": {
        "link": "<string>"
      },
      "tags": [
        "<string>"
      ]
    }
  }
}
'
{}

Body

application/json
id
object

Encapsulation of fields that uniquely identifies a Flyte resource.

spec
object

Represents a structure that encapsulates the user-configured specification of the task.

Response

A successful response.

Represents a response structure if task creation succeeds.

Purposefully empty, may be populated in the future.